package com.tiger.cloud.model.crm;

import java.io.UnsupportedEncodingException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.tiger.cloud.common.mybatis.TigerBaseEntity;
import com.tiger.cloud.enums.CreditStatusEnum;
import com.tiger.cloud.enums.DeleteEnum;
import com.tiger.cloud.enums.GenderEnum;
import com.tiger.cloud.enums.IdentityEnum;
import com.tiger.cloud.security.EncodeUtil;

import io.swagger.annotations.ApiModelProperty;
/**
 * 
 * crm_customer-客户
 *
 */
public class Customer extends TigerBaseEntity{

	private static final long serialVersionUID = 1L;
    
	/**
	 * 姓名
	 */
	@ApiModelProperty(value = "姓名")
    private String custName;
	/**
	 * 所属用户
	 */
	@ApiModelProperty(value = "所属用户")
    private Long userId;
	/**
	 * 
	 */
	@ApiModelProperty(value = "电话")
    private String mobile;
	/**
	 * 
	 */
	@ApiModelProperty(value = "微信")
    private String weixin;
	/**
	 * 头像   不上传图片则显示默认头像
	 */
	@ApiModelProperty(value = "头像 ")
    private String headImage;
	/**
	 * 年龄
	 */
	@ApiModelProperty(value = "年龄 ")
    private Integer age;
	/**
	 * 
	 */
	@ApiModelProperty(value = "性别 ")
    private GenderEnum gender;
	/**
	 * 是否删除, 0:正常,1:删除
	 */
	@ApiModelProperty(value = "是否删除, 0:正常,1:删除 ")
    private DeleteEnum isDelete;
	/**
	 * 
	 */
	@ApiModelProperty(value = "创建时间")
    private Timestamp createTime;
	/**
	 * 
	 */
	@ApiModelProperty(value = "创建时间")
    private Timestamp lastUpdateTime;
	/**
	 * 
	 */
	@ApiModelProperty(value = "最后比对时间")
	private Timestamp lastCompareTime;
	/**
	 * 出生
	 */
	@ApiModelProperty(value = "出生 ")
	@DateTimeFormat(pattern="yyyy-MM-dd")   
	@JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8") 
    private Date born;
	/**
	 * 客户信用状况
	 */
	@ApiModelProperty(value = "客户信用状况")
    private CreditStatusEnum creditStatus;
	
	@ApiModelProperty(value = "身份")
    private IdentityEnum identity;
	@ApiModelProperty(value = "籍贯->省")
    private Long origoProvinceId;
	@ApiModelProperty(value = "籍贯->市")
    private Long origoCityId;
	@ApiModelProperty(value = "籍贯->区")
    private Long origoDistrictId;
	@ApiModelProperty(value = "籍贯->省")
    private String origoProvinceName;
	@ApiModelProperty(value = "籍贯->市")
    private String origoCityName;
	@ApiModelProperty(value = "籍贯->区")
    private String origoDistrictName;
	
	@ApiModelProperty(value = "居住区域->省")
    private Long addressProvinceId;
	@ApiModelProperty(value = "居住区域->市")
    private Long addressCityId;
	@ApiModelProperty(value = "居住区域->区")
    private Long addressDistrictId;
	@ApiModelProperty(value = "居住区域->省")
    private String addressProvinceName;
	@ApiModelProperty(value = "居住区域->市")
    private String addressCityName;
	@ApiModelProperty(value = "居住区域->区")
    private String addressDistrictName;
	
	/**
	 * 从事工作
	 */
	@ApiModelProperty(value = "从事工作")
    private String userWork;
	/**
	 * 个人备注说明
	 */
	@ApiModelProperty(value = "个人备注说明")
    private String remark;
	@JsonIgnore
	private String remark_;
	/**
	 * 附件
	 */
	@ApiModelProperty(value = "附件")
    private String attachment;
	/**
	 * 扩展参数
	 */
	private List<LoanInfo> loanInfos=new ArrayList<LoanInfo>();
	/**
	 * 等级
	 */
	private String level;
	/**
	 * 最后沟通时间
	 */
	@ApiModelProperty(value = "最后沟通时间")
	private Timestamp lastCommunicateTime;
    
    public Customer(){
    
    }
    
	public Timestamp getLastCompareTime() {
		return lastCompareTime;
	}

	public void setLastCompareTime(Timestamp lastCompareTime) {
		this.lastCompareTime = lastCompareTime;
	}

	public Timestamp getLastCommunicateTime() {
		return lastCommunicateTime;
	}

	public void setLastCommunicateTime(Timestamp lastCommunicateTime) {
		this.lastCommunicateTime = lastCommunicateTime;
	}

	public String getAttachment() {
		return attachment;
	}

	public void setAttachment(String attachment) {
		this.attachment = attachment;
	}

	public String getLevel() {
		return level;
	}

	public void setLevel(String level) {
		this.level = level;
	}

	public List<LoanInfo> getLoanInfos() {
		return loanInfos;
	}

	public void setLoanInfos(List<LoanInfo> loanInfos) {
		this.loanInfos = loanInfos;
	}

	public String getCustName() {
        return this.custName;
    }
    
    public void setCustName(String custName) {
        this.custName = custName;
    }
    public Long getUserId() {
        return this.userId;
    }
    
    public void setUserId(Long userId) {
        this.userId = userId;
    }
    public String getMobile() {
        return this.mobile;
    }
    
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
    public String getWeixin() {
        return this.weixin;
    }
    
    public void setWeixin(String weixin) {
        this.weixin = weixin;
    }
    public String getHeadImage() {
        return this.headImage;
    }
    
    public void setHeadImage(String headImage) {
        this.headImage = headImage;
    }
    public Integer getAge() {
        return this.age;
    }
    
    public void setAge(Integer age) {
        this.age = age;
    }
   
  
    public Long getOrigoProvinceId() {
		return origoProvinceId;
	}

	public void setOrigoProvinceId(Long origoProvinceId) {
		this.origoProvinceId = origoProvinceId;
	}

	public Long getOrigoCityId() {
		return origoCityId;
	}

	public void setOrigoCityId(Long origoCityId) {
		this.origoCityId = origoCityId;
	}

	public Long getOrigoDistrictId() {
		return origoDistrictId;
	}

	public void setOrigoDistrictId(Long origoDistrictId) {
		this.origoDistrictId = origoDistrictId;
	}

 
	public Long getAddressProvinceId() {
		return addressProvinceId;
	}

	public void setAddressProvinceId(Long addressProvinceId) {
		this.addressProvinceId = addressProvinceId;
	}

	public Long getAddressCityId() {
		return addressCityId;
	}

	public void setAddressCityId(Long addressCityId) {
		this.addressCityId = addressCityId;
	}

	public Long getAddressDistrictId() {
		return addressDistrictId;
	}

	public void setAddressDistrictId(Long addressDistrictId) {
		this.addressDistrictId = addressDistrictId;
	}

	public String getOrigoProvinceName() {
		return origoProvinceName;
	}

	public void setOrigoProvinceName(String origoProvinceName) {
		this.origoProvinceName = origoProvinceName;
	}

	public String getOrigoCityName() {
		return origoCityName;
	}

	public void setOrigoCityName(String origoCityName) {
		this.origoCityName = origoCityName;
	}

	public String getOrigoDistrictName() {
		return origoDistrictName;
	}

	public void setOrigoDistrictName(String origoDistrictName) {
		this.origoDistrictName = origoDistrictName;
	}

	public String getAddressProvinceName() {
		return addressProvinceName;
	}

	public void setAddressProvinceName(String addressProvinceName) {
		this.addressProvinceName = addressProvinceName;
	}

	public String getAddressCityName() {
		return addressCityName;
	}

	public void setAddressCityName(String addressCityName) {
		this.addressCityName = addressCityName;
	}

	public String getAddressDistrictName() {
		return addressDistrictName;
	}

	public void setAddressDistrictName(String addressDistrictName) {
		this.addressDistrictName = addressDistrictName;
	}

	public DeleteEnum getIsDelete() {
		return isDelete;
	}

	public void setIsDelete(DeleteEnum isDelete) {
		this.isDelete = isDelete;
	}

	public Timestamp getCreateTime() {
        return this.createTime;
    }
    
    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }
    public Timestamp getLastUpdateTime() {
        return this.lastUpdateTime;
    }
    
    public void setLastUpdateTime(Timestamp lastUpdateTime) {
        this.lastUpdateTime = lastUpdateTime;
    }
    public Date getBorn() {
        return this.born;
    }
    
    public void setBorn(Date born) {
        this.born = born;
    }
    
    public GenderEnum getGender() {
		return gender;
	}

	public void setGender(GenderEnum gender) {
		this.gender = gender;
	}

	public CreditStatusEnum getCreditStatus() {
		return creditStatus;
	}

	public void setCreditStatus(CreditStatusEnum creditStatus) {
		this.creditStatus = creditStatus;
	}


    public IdentityEnum getIdentity() {
		return identity;
	}

	public void setIdentity(IdentityEnum identity) {
		this.identity = identity;
	}

	public Long getProvinceId() {
        return this.origoProvinceId;
    }
    
    public void setProvinceId(Long provinceId) {
        this.origoProvinceId = provinceId;
    }
    public Long getCityId() {
        return this.origoCityId;
    }
    
    public void setCityId(Long cityId) {
        this.origoCityId = cityId;
    }
    public Long getDistrictId() {
        return this.origoDistrictId;
    }
    
    public void setDistrictId(Long districtId) {
        this.origoDistrictId = districtId;
    }
    
    
	public String getUserWork() {
		return userWork;
	}

	public void setUserWork(String userWork) {
		this.userWork = userWork;
	}
	public String getRemark_() {
		if( null == remark){
			return null;
		}
		try {
			return EncodeUtil.urlEncode(remark);
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		};
		return null;
	}

	public void setRemark_(String remark_) {
		if(null == remark_){
			return;
		}
		try {
			this.remark= EncodeUtil.urlDecode(remark_);
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		};
	}

	public String getRemark() {
		if(null == remark){
			return null;
		}
		try {
			return EncodeUtil.urlDecode(remark);
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		};
		return null;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}

}